﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace JeanFish.UnitTest.Security
{
    [TestClass]
    public partial class HashHelperTest
    {

        private string sample;
        private string actual_md5;
        private string actual_sha256;
        private string actual_sha512;

        [TestInitialize]
        public void TestInitialize()
        {
            InitializeSample();
        }
        partial void InitializeSample();
        [TestMethod]
        [ExpectedException(typeof(NotSupportedException))]
        public void ComputeAndVerifyHashTest()
        {
            string result = "";
            TestMD5ComputeHash(sample,ref result);
            Assert.AreEqual(actual_md5, result);
            TestSHA256ComputeHash(sample, ref result);
            Assert.AreEqual(actual_sha256, result);
            TestSHA512ComputeHash(sample,ref result);
            Assert.AreEqual(actual_sha512, result);
            TestNotSupportedHashAlgorithm(sample, ref result);
        }

        partial void TestMD5ComputeHash(string data,ref string hash);
        partial void TestSHA256ComputeHash(string data, ref string hash);
        partial void TestSHA512ComputeHash(string data, ref string hash);
        partial void TestNotSupportedHashAlgorithm(string data, ref string hash);
    }
}
